home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Icon / c / WhichRadio < prev   
Text File  |  1995-07-08  |  742b  |  29 lines

  1. #include "DeskLib:Wimp.h"
  2. #include "DeskLib:WimpSWIs.h"
  3. #include "DeskLib:Icon.h"
  4.  
  5.  
  6. extern int Icon_WhichRadio(window_handle window,
  7.                            icon_handle first, icon_handle last)
  8. /*
  9.  * This function accepts parameters for the first (lowest numbered) and
  10.  * last (highest numnbered) in a group of icons (generally a group of radio
  11.  * buttons). It returns the icon number of the first icon it finds within
  12.  * this range which is selected (or "last" if none are selected).
  13.  * Use it to find which of a group of radios is selected.
  14.  */
  15. {
  16.   icon_block istate;
  17.  
  18.   while (first < last)
  19.   {
  20.     Wimp_GetIconState(window, first, &istate);
  21.     if (istate.flags.data.selected)
  22.       return(first);
  23.  
  24.     first++;
  25.   }
  26.  
  27.   return(last);
  28. }
  29.